 <meta charset="utf-8">
 <div class="box" id="biz_practitioner_conatainer">
            <div class="box-header with-border">
               <form id="searchForm" role="form" class="form-inline">
                    <div class="form-group">
                         <label>执业人员姓名</label>
                         <input name="name" v-model="searchForm.name"   type="text" placeholder="" class="form-control">
                    </div>
                    
                      <div class="form-group">
                         <label>执业证号</label>
                         <input name="number" v-model="searchForm.number"   type="text" placeholder="" class="form-control">
                    </div>
                    
	                 <div class="form-group">
						<label for="orgId" class="control-label">所属单位</label>
	                  	<select id="orgId" v-model="searchForm.orgId" name="orgId" v-kselect="{url:'tcms/orgnization/loadOrgnizationComboboVo',vmodel:'practitioner.orgId',firstEmpty:'true'}" class=" form-control"   required> </select>
					</div>
                     <button type="button"  class="btn btn-info pull-right m-t-n-xs" v-kperms="{perm:'authRole:loadAuthRoleList'}"  v-on:click="search();"><strong>查询</strong></button>
                </form>
            </div>
 <div class="box-body">
 	<div class="row">
 	  <div class="col-md-12">
 	                           <div class="btn-group " id="practitionerBTableToolbar" role="group">
 	                           		<button type="button" v-kperms="{perm:'authRole:addRole'}"  class="btn btn-default" v-on:click="add">
                                        <i class="glyphicon glyphicon-plus" aria-hidden="true"></i> 添加
                                    </button>
                                     <button type="button"  v-kperms="{perm:'authRole:updateRole'}" class="btn btn-default" v-on:click="edit">
                                        <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i> 修改
                                    </button>
                                     <button type="button"  v-kperms="{perm:'authRole:setAuthRoleEnabled'}" class="btn btn-default" v-on:click="setEnable">
                                        <i class="glyphicon glyphicon-ok" aria-hidden="true"></i> 启用
                                    </button>
                                     <button type="button"  v-kperms="{perm:'authRole:setAuthRoleEnabled'}" class="btn btn-default" v-on:click="setDisable">
                                        <i class="glyphicon glyphicon-remove" aria-hidden="true"></i> 锁定
                                    </button>
                                    <!--    <button type="button"  v-kperms="{perm:'authRole:deletAuthRole'}" class="btn btn-default" v-on:click="deletex">
                                        <i class="glyphicon glyphicon-trash" aria-hidden="true"></i> 删除
                                    </button> -->
                                    
                                    <button type="button"  class="btn btn-default" v-on:click="resetpwd">
                                        <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i> 修改密码
                                    </button>
                                    
                           </div>
            <div  style="height: 580px;overflow-y:scroll; ">
          	 <table id="practitionerBTable" data-mobile-responsive="true" ></table>
           </div>                      
          
 	  </div>
 	</div>
 </div>
 </div>

<script> 
new Vue({  
	  el: '#biz_practitioner_conatainer',  
	  data:{
		  searchForm:{
			  name: null,
			  number: null,
			  orgId:null
		  },
		  bus:new Vue(),
	  },
	  mounted:function(){
		 let _this=this;
		 _this.initTable();
	  },
  methods: {
	  initTable:function(){
		  let　_this=this;
		  let columns=[
				{checkbox:true},
				{field:'name',title:'人员姓名',width:100},
				{field:'number',title:'执业证号',width:100},
				{field:'phone',title:'电话',width:100},
				{field:'orgName',title:'所属部门',width:100},
				{field:'gender',title:'性别',width:60,formatter: function(value,row,index){
							  if("1"==value||1==value){return '<span class="label label-success">男</span>';
						}else if("2"==value||2==value){return '<span class="label label-success">女</span>';
						}else{return value;}
					}},
				{field:'idCard',title:'身份证号码',width:100},
				{field:'positionTime',title:'执业初始时间',width:100},
				{field:'zzmm',title:'政治面貌',width:100},
				{field:'enabled',title:'人员状态',width:100,formatter:zfesUtil.formatEnabled},
				{field:'remark',title:'备注描述',width:300}];
		  let url="tcms/practitioner/loadPractitionerDataSet";
  		zfesBstable.laodTable($("#practitionerBTable"),$("#searchForm"),$("#practitionerBTableToolbar"),url,columns,this.searchForm);
	  },
	  search:function(){
		  zfesBstable.reload($("#practitionerBTable")); 
	  },
	  refresh:function(){
		  zfesBstable.refresh($("#practitionerBTable"));
	  },
	  add:function(){
		  let　_this=this;
		 var url="/view/tcms/practitioner/practitioner.add.html";
		 zfesLayerEditDg.open(url,{},"执业人员信息编辑",750,function(){_this.refresh();});
		 
	  },
	  resetpwd:function(){
		  if(zfesBstable.isOneRow($("#practitionerBTable"))){
			  let　_this=this;
			  let id=zfesBstable.getRowId($("#practitionerBTable"));
			  var url="/view/tcms/lauthuser/lauthuser.setpwd.html";
			  zfesLayerEditDg.open(url,{"id":id},"账号信息编辑",460,function(){_this.refresh();}); 
		 }
	  },
	  edit:function(){
		  if(zfesBstable.isOneRow($("#practitionerBTable"))){
			  let　_this=this;
			  let id=zfesBstable.getRowId($("#practitionerBTable"));
			  var url="/view/tcms/practitioner/practitioner.edit.html";
			  zfesLayerEditDg.open(url,{"id":id},"执业人员信息编辑",750,function(){_this.refresh();}); 
		 }
	  },
	  
	  setEnable:function(){
		  if(zfesBstable.isSelectedRow($("#practitionerBTable"))){
			  let ids=zfesBstable.getRowIds($("#practitionerBTable"));
			  let　_this=this;
				 alertSwal.confirm("启用","是否执行该操作",function(){
						    let ajaxUrl = "tcms/practitioner/setPractitionerEnabled";
						    zfesAjax.ajaxTodo(ajaxUrl, { "ids" : ids,"enabled":true}, function(data) {
								alertSwal.successText(data.message);
								_this.refresh();
							});
						});
		  }
	  },
	  setDisable:function(){
		  if(zfesBstable.isSelectedRow($("#practitionerBTable"))){
			  let ids=zfesBstable.getRowIds($("#practitionerBTable"));
			  let　_this=this;
				 alertSwal.confirm("禁用","是否执行该操作",function(){
						    let ajaxUrl = "tcms/practitioner/setPractitionerEnabled";
						    zfesAjax.ajaxTodo(ajaxUrl, {"ids" : ids,"enabled":false}, function(data) {
								alertSwal.successText(data.message);
								_this.refresh();
						});
		  		});
		  }
	  },
	  deletex: function(){ 
			if(zfesBstable.isOneRow($("#practitionerBTable"))){
				  let　_this=this;
					var id=zfesBstable.getRowId($("#practitionerBTable"));
					 alertSwal.confirm("删除","是否执行该操作",function(){
						    let ajaxUrl = "tcms/practitioner/deletPractitioner";
							zfesAjax.ajaxTodo(ajaxUrl, { "id" : id}, function(data) {
								alertSwal.successText(data.message);
								_this.refresh();
							},function(data){
								
							}); 
				});
			}
				
	  }
 },
 formatGenderxxx: function(value,row,index){
	 alert("----------");
		if("1"==value||1==value){
			return '<span class="label label-success">男</span>';
		}else if("2"==value||2==value){
			return '<span class="label label-success">女</span>';
		}else{
			return value;
		}
	}
});
</script>


